package com.jdrx.sw.sewage.service;

import com.github.pagehelper.PageHelper;
import com.jdrx.platform.commons.rest.beans.dto.IdDTO;
import com.jdrx.sw.sewage.beans.dto.base.PageDTO;
import com.jdrx.sw.sewage.beans.entity.AiReportPO;
import com.jdrx.sw.sewage.beans.vo.AiWindReportVO;
import com.jdrx.sw.sewage.beans.vo.base.PageVO;
import com.jdrx.sw.sewage.common.enums.EAiStatisticsType;
import com.jdrx.sw.sewage.dao.AiReportDAO;
import com.jdrx.sw.sewage.service.base.BaseServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AiReportServiceImpl extends BaseServiceImpl {

    public static final Logger logger = LoggerFactory.getLogger(AiReportServiceImpl.class);

    @Autowired
    private AiReportDAO aiReportDAO;

    public List<AiWindReportVO> findCarbonSourceAiWind(String parentModeName) {
        return aiReportDAO.findCarbonSourceAiWind(EAiStatisticsType.AI_WINDOW_DATA.getKey(), parentModeName);
    }

    public PageVO<AiReportPO> selectWeekReportByPage(PageDTO dto, String parentName, Integer type) {
        PageHelper.startPage(dto);
        return PageVO.toPageVO(aiReportDAO.selectWeekReportByPage(type, parentName));
    }

    public AiReportPO selectWeekReportById(IdDTO dto) {
        return aiReportDAO.selectWeekReportById(dto);
    }
}
